<include file="Common:header_new_template"/>
<style>
	.top{
		height:60px;
		padding-left:30px;
		font-size:15px;
		line-height: 60px;
		background-color:white;
		margin-top:10px;
		border-top:1px #c9ccce solid;
		border-bottom:1px solid #eee;
	}
	.top label{
		font-size:15px;
	}
	.button{
		width:100%;
		text-align: center;
		height:60px;
		margin-top: 40px;
	}
	.buttom_sumbit{
		width:46%;
		border-radius:8px;
		height:34px;
		background-color:#4084bb;
		color:white;
	}
	.form-control{
		width:60%;
		border-radius:8px;
		height:34px;
		border:1px solid #c9ccce;
	}
	.middle_style{
		height:60px;
		padding-left:30px;
		font-size:15px;
		line-height: 60px;
		background-color:white;
		border-bottom:1px solid #eee;
	}
 
 
</style>
<html>
<body style="position:relative;margin:0 auto">
	<div class="header">
		新建链接
		<a href="javascript:history.back();" class="left back">
			<span class="back_cs">返回</span>
		</a>
	</div>
	<form class="">
		<div class="top" style="border-bottom:0px">
			链接名称:
			<label><input name="title" class="form-control" id="title" value="<{$return['title']}>" /></label>
		</div>
		<div class="middle_style" >
			链接URL:
			<label><input name="link" class="form-control" id="link" value="<{$return['link']}>" /></label>
		</div>
		
		<input type="hidden" name="link_id" value="<{$return['id']}>">
	</form>

	<div class="button">
		<button type="button" class="buttom_sumbit">
			保存
		</button>
	</div>

	<script>
		$("button").click(function(){
			var title  = $("#title").val();
			var link   = $('#link').val();
			
			if(title == ''){
				layer.open({
					content:'请填写链接名称',
				});
				return false;
			}
			
			if(link == ''){
				layer.open({
					content:'请填写链接url',
				});
				return false;
			}
			
			$.ajax({
				type: "POST",
				url: "<{:U('Home/Quicklink/create_quick_link')}>",
				data: $("form").serializeArray(),
				success: function(msg){
					open_layer(msg);
				}
			});
		});
	</script>
</body>
</html>